<?php
/*
 *---------------------------------------------------------------------------
 *
 *                  T E N C E N T   P R O P R I E T A R Y
 *
 *     COPYRIGHT (c)  2008 BY  TENCENT  CORPORATION.  ALL RIGHTS
 *     RESERVED.   NO  PART  OF THIS PROGRAM  OR  PUBLICATION  MAY
 *     BE  REPRODUCED,   TRANSMITTED,   TRANSCRIBED,   STORED  IN  A
 *     RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER
 *     LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,
 *     MAGNETIC,  OPTICAL,  CHEMICAL, MANUAL, OR OTHERWISE,  WITHOUT
 *     THE PRIOR WRITTEN PERMISSION OF :
 *
 *                        TENCENT  CORPORATION
 *
 *       Advertising Platform R&D Team, Advertising Platform & Products
 *       Tencent Ltd.
 *---------------------------------------------------------------------------
 */

/**
 * The basic class for web request and console request
 *
 * @package lib.request
 * @version TMRequest.class.php 2008-9-12 by ianzhang
 */
abstract class JYRequest {
	/**
	 * Process validation and execution for only GET requests.
	 *
	 */
	const GET = 2;

	/**
	 * Skip validation and execution for any request method.
	 *
	 */
	const NONE = 1;

	/**
	 * Process validation and execution for only POST requests.
	 *
	 */
	const POST = 4;

	/**
	 * Process validation and execution for only PUT requests.
	 *
	 */
	const PUT = 5;

	/**
	 * Process validation and execution for only DELETE requests.
	 *
	 */
	const DELETE = 6;

	/**
	 * Process validation and execution for only HEAD requests.
	 *
	 */
	const HEAD = 7;

	protected $method = 0;

	/**
	 * construct
	 * Class constructor.
	 *
	 * @param    array                         $parameters    An associative array of initialization parameters
	 * @param    array                         $attributes    An associative array of initialization attributes
	 *
	 */
	public function __construct($parameters = array(), $attributes = array()) {
	}

	/**
	 * Retrieves this request's method.
	 *
	 * @return int One of the following constants:
	 *                         - JYRequest::GET
	 *                         - JYRequest::POST
	 */
	public function getMethod() {
		return $this->method;
	}

	public function setMethod($method) {
		$this->method = $method;
	}
}